<?php
$this->Html->css('controllers/Trainings/index.css?1', array('block' => 'stylesTop'));
$this->Html->script('controllers/Trainings/index.js?1', array('block' => 'scriptBottom'));
$appBosch->crud = $this->TioCachas->urlsCRUD();
$appBosch->urlDetails = $this->Html->url(array('action'=>'getDetails'));
$appBosch->iTrainings = 1;
$appBosch->urlStartExam = $this->Html->url( array('controller' => 'Exams', 'action' => 'index'));
?>
<script id="templateProximos" type="text/kendo-template">
    #if(proximos == 1 ){#
        <i class='fa fa-clock-o proximo' style="color:red; font-size:3rem; display:block; text-align:center;" title='<?php echo __('Certificación en entrenamiento próxima a caducar');?>'</i>
    #}#
</script>

<script id="templateDetalles" type="text/kendo-template">
    <h4><?php echo __('En entrenamiento');?></h4>
    <table class="table table-bordered table-condensed table-striped table-hover">
        <thead>
        <tr>
            <th><?php echo __('Tema');?></th>
            <th><?php echo __('Calificación');?></th>
            <th><?php echo __('Fecha');?></th>
        </tr>
        </thead>
        <tbody>
        # for (i = 0; i < data.training.length; i++) { #
        <tr>
            <td>#= data.training[i].workstation_config_name #</td>
            <td>#= data.training[i].certification_detail_qualification #</td>
            <td title="#=kendo.toString(new Date(data.training[i].certification_detail_date.replace(/-/g, '/')), 'D')#">
                #=kendo.toString(new Date(data.training[i].certification_detail_date.replace(/-/g, "/")), "d")#
            </td>
        </tr>
        # } #
        </tbody>
    </table>
    # if ( data.left.length > 0 ) { #
        <h4><?php echo __('Faltantes');?></h4>
        <table class="table table-bordered table-condensed table-striped table-hover">
            <thead>
            <tr>
                <th><?php echo __('Tema');?></th>
            </tr>
            </thead>
            <tbody>
            # for (i = 0; i < data.left.length; i++) { #
            <tr>
                <td>#= data.left[i].workstation_config_name #</td>
            </tr>
            # } #
            </tbody>
        </table>
    # } #
</script>

<div id="grid"></div>
<?php $this->start('jsVars'); ?>
<script type="text/javascript">
    var appBosch = <?php echo json_encode($appBosch); ?>;
</script>
<?php $this->end();